using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using System.Threading.Tasks;

[Api]
public static class CwApi 
{
    //public class Code2TokenResponse
    //{
    //    public string token;
    //}

    //public static async Task<Code2TokenResponse> Code2TokenAsync(string code)
    //{
    //    var api = "login/code2Token";
    //    var param = new Dictionary<string, string>();
    //    param["code"] = code;
    //    var data = await PcmRpc.RequestAsync<Code2TokenResponse>(api, param);
    //    return data;
    //}

    //public class UserInfo
    //{
    //    public string nickname;
    //    public string username;
    //    public string email;
    //    public string openId;
    //}

    //public static async Task<UserInfo> GetUserInfoAsync(string accessToken)
    //{
    //    var api = "login/getUserInfo";
    //    var param = new Dictionary<string, string>();
    //    param["accessToken"] = accessToken;
    //    var data = await PcmRpc.RequestAsync<UserInfo>(api, param);
    //    return data;
    //}

    //public class PrePayAsyncResponse
    //{
    //    public string prepayId;
    //}

    //public static async Task<PrePayAsyncResponse> PrePayAsync(string outTradeNo, double amount, string description, string returnUrl)
    //{
    //    var api = "pay/prePay";
    //    var param = new Dictionary<string, string>();
    //    param["outTradeNo"] = outTradeNo;
    //    param["amount"] = amount.ToString();
    //    param["description"] = description;
    //    param["returnUrl"] = returnUrl;
    //    var data = await PcmRpc.RequestAsync<PrePayAsyncResponse>(api, param);
    //    return data;
    //}

    //public class PayResult
    //{
    //    public string outTradeNo;
    //    public double amount;

    //    /**
    //     * pay.success or pay.fail
    //     */
    //    public string eventType;
    //    public string txHash;
    //    public string errorMsg;
    //}

    //public static async Task<PayResult> QueryPayResultAsync(string outTradeNo)
    //{
    //    var api = "pay/queryPayResult";
    //    var param = new Dictionary<string, string>();
    //    param["outTradeNo"] = outTradeNo;
    //    var data = await PcmRpc.RequestAsync<PayResult>(api, param);
    //    return data;
    //}
}
